﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace libReadWrite
{
    public class BigEndianReaderForBluetooth: BigEndianReader
    {
        private readonly BinaryReader mBaseReader;

        public BigEndianReaderForBluetooth(BinaryReader baseReader)
        {
            mBaseReader = baseReader;
        }

        
        public override byte[] ReadBigEndianBytes(int count)
        {
            byte[] bytes = new byte[count];
            for (int i = count - 1; i >= 0; i--)
                bytes[i] = mBaseReader.ReadByte();

            return bytes;
        }

        public override byte ReadByte()
        {
            return mBaseReader.ReadByte();
        }

        public override byte[] ReadBytes(int count)
        {
            return mBaseReader.ReadBytes(count);
        }

        public override void Close()
        {
            mBaseReader.Close();
        }
    }
}
